﻿
@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<style>
    .form .formValue input.form-control {
        height: 34px;
        line-height: 34px;
    }

    .form-control {
        padding: 0px;
    }

    .Table {
        width: 100%;
        margin: 0px;
        padding: 0px;
        border-collapse: collapse;
        border-width: 3px 1px 1px;
        table-layout: fixed;
    }
    .form .formTitle {
        width:80px;
    }
    .form .formValue textarea.form-control {
        width:99%;
    }
</style>
<script>
    var F_Id = $.request("F_Id");
    var F_CheckId = $.request("F_CheckId");
    var F_FlowId = $.request("F_FlowId");
    var ApplyType = $.request("ApplyType");
    var F_CheckUserId = $.request("F_CheckUserId");
    var resultData = {};
    $(function () {
        getItemList();
    });

    function getItemList() {
        resultData = getCache("CHECK_COMFORM");
        if (!resultData || resultData.length <= 0) {
            $.ajax({
                url: "/CheckManager/CheckInfos//GetItemList",
                dataType: "json",
                async: false,
                success: function (data) {
                    if (data.wdqly.length > 0) {
                        for (var i = 0; i < data.wdqly.length; i++) {
                            $("#F_Reason").append("<option value='" + data.wdqly[i].F_ItemCode + "'>" + data.wdqly[i].F_ItemName + "</option>");
                        }
                    }
                    resultData = data;
                    setCache("CHECK_COMFORM", data);
                }, error: function (XMLHttpRequest, textStatus, errorThrown) {

                }
            });
        } else {
            var data = resultData;
            if (data.wdqly.length > 0) {
                for (var i = 0; i < data.wdqly.length; i++) {
                    $("#F_Reason").append("<option value='" + data.wdqly[i].F_ItemCode + "'>" + data.wdqly[i].F_ItemName + "</option>");
                }
            }
        }
        
    }

    function submitForm() {
        if (!$('#projectForm').formValid()) {
            return false;
        }

        var F_Reason = $("#F_Reason").val();
        var F_Remark = $("#F_Remark").val();

        $.submitForm({
            url: "/CheckManager/CheckInfos/SubmitFormCheck",
            param: {
                F_Id: F_Id, F_CheckId: F_CheckId, F_Reason: F_Reason, F_Remark: F_Remark, F_FlowId: F_FlowId, ApplyType: ApplyType, F_CheckUserId: F_CheckUserId
            },
            success: function () {                
                top.frames["checkDetail"].$("#gridList").trigger("reloadGrid");
            }
        });
    }
</script>
<div id="ProjectsDetail">
    <form id="projectForm">
        <table class="form">            
            <tr>
                <td colspan="6">
                    <table class="Table">
                        <tr>
                            <td class="formTitle">驳回理由</td>
                            <td class="formValue" colspan="3">
                                <select id="F_Reason" name="F_Reason" class="form-control required">
                                    <option value="">==请选择驳回理由==</option>
                                </select>
                            </td>                                      
                        </tr>
                        <tr>

                            <td class="formTitle">备注</td>
                            <td class="formValue" colspan="3">
                                <textarea id="F_Remark" name="F_Remark"  class="form-control required" rows="4"></textarea>
                            </td>                            
                        </tr>                        
                    </table>
                </td>
            </tr>        
        </table>
    </form>
</div>

